<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>栏目管理-<?php echo $cfg_sitename."-".$cfg_sysversion;?></title>
<meta property="xn:admins" content="583870616"/>
<meta property="wb:webmaster" content="ye-shi-li@qq.com">
<link href="templets/css/admin_css.css" rel="stylesheet" type="text/css" />
</head>
<script>
function checkreg()
{
if (document.getElementById('title').value=="") {
	window.alert("栏目名称不能为空！！");
	document.getElementById('title').focus();		
	 return (false);
	}
if (document.getElementById('url').value=="") {
	window.alert("栏目路径不能为空！！");
	document.getElementById('url').focus();		
	 return (false);
	}
if (!document.getElementById('display').checked) {
	window.alert("请选择是否隐藏！！");	
	 return (false);
	}
if (document.getElementById('rank').value=="") {
	window.alert("排序ID不能为空！！");
	document.getElementById('rank').focus();		
	 return (false);
	}
	return true;
}
</script>
</head>
<body>
<?php
if($act == "add"){
?>
<form name="myform" action="admin_action_ok.php?act=add" method="post" onSubmit="return checkreg();">
<table width="400" border="0" cellpadding="3" cellspacing="1">
    <tr>
      <td height="24" colspan="2" bgcolor="#555555" align="center"><font color="#FFFFFF">&nbsp;<strong>添加栏目</strong></font></td>
    </tr>
    <tr>
      <td width="100" height="24" align="right" valign="middle" bgcolor="#f1f1f1">上级栏目：</td>
      <td width="300" height="24" align="left" valign="middle" bgcolor="#f1f1f1"><select name="fid" class="select">
          <option value="0">--顶级栏目--</option>
          <?php getActionSelect("action",$fid); ?>
          </select>
      </td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">栏目名称：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="title" type="text" id="title" size="20" class="yeshili"/></td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">栏目URL：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="url" type="text" id="url" size="30" class="yeshili"/></td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">是否隐藏：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input type="radio" name="display" value="0" id="display" />显示&nbsp;<input type="radio" name="display" value="1" id="display" />隐藏</td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">排序ID：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="rank" type="text" id="rank" size="10" value="0" class="yeshili"/></td>
    </tr>
    <tr>
      <td height="24" bgcolor="#f1f1f1">&nbsp;</td>
      <td height="24" bgcolor="#f1f1f1"><input type="submit" name="button" id="button" value="提交" class="button"/> <input type="button" name="back" id="back" value="返回" onclick="javascript:$.fancybox.close();" class="button"/></td>
    </tr>
</table>
</form>
<?php
}
?>
<?php
if($act == "mod"){
	$sql = get_sql("select * from {pre}action where id=".$id);
	$list = $db->getonerow($sql);
?>
<form name="myform" action="admin_action_ok.php?act=mod" method="post" onSubmit="return checkreg();">
<table width="400"  border="0" cellpadding="3" cellspacing="1" class="ye">
    <tr>
      <td height="24" colspan="2" bgcolor="#555555" align="center"><font color="#FFFFFF">&nbsp;<strong>修改栏目</strong></font></td>
    </tr>
    <tr>
      <td width="100" height="24" align="right" valign="middle" bgcolor="#f1f1f1">上级栏目：</td>
      <td width="300" height="24" align="left" valign="middle" bgcolor="#f1f1f1"><select name="fid" class="select">
          <option value="0">--顶级栏目--</option>
          <?php getActionSelect("action",$list['fid']); ?>
          </select>
      </td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">栏目名称：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="title" type="text" id="title" size="20" value="<?php echo $list['title'];?>" class="yeshili"/></td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">栏目URL：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="url" type="text" id="url" size="30" value="<?php echo $list['url'];?>" class="yeshili"/></td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">是否隐藏：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input type="radio" name="display" value="0" <?php if($list['display']==0) echo 'checked';?>/>显示&nbsp;<input type="radio" name="display" value="1" <?php if($list['display']==1) echo 'checked';?>/>隐藏</td>
    </tr>
    <tr>
      <td height="24" align="right" valign="middle" bgcolor="#f1f1f1">排序ID：</td>
      <td height="24" align="left" valign="middle" bgcolor="#f1f1f1"><input name="rank" type="text" id="rank" size="10" value="<?php echo $list['rank'];?>" class="yeshili"/></td>
    </tr>
    <tr>
      <td height="24" bgcolor="#f1f1f1">&nbsp;</td>
      <td height="24" bgcolor="#f1f1f1"><input type="hidden" value="<?php echo $list['id'];?>" name="id" id="id"><input type="submit" name="button" id="button" value="提交" class="button"/> <input type="button" name="back" id="back" value="返回" onclick="javascript:$.fancybox.close();" class="button"/></td>
    </tr>
</table>
</form>
<?php
}
?>
</body>
</html>